<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>2018/12/4</title>
    <!--好的代码像粥一样,是得用时间和精力熬的。-->
</head>
<body>
<div id="star">
</div>
</body>
<script>
    function Star(config) {
        this.el = typeof config.el === 'string' ? document.getElementById(config.el): config.el;

    }
    Star.prototype = {
        constructor: Star,
        init: function () {
            var span = document.createElement('span');
            span.className = 'stat--item';
            this.el.appendChild(span);
        }
    };
    new Star({

        el: document.getElementById('star'),
        beforeInit: function() {

        },
        inited: function() {

        }

    })
</script>
</html>